using Microsoft.Extensions.Options;

namespace DatabaseManager.Services;

public class AdminCredentials
{
    public string Username { get; set; } = string.Empty;
    public string Password { get; set; } = string.Empty;
}

public interface IAuthenticationService
{
    bool ValidateCredentials(string username, string password);
}

public class AuthenticationService : IAuthenticationService
{
    private readonly AdminCredentials _adminCredentials;

    public AuthenticationService(IOptions<AdminCredentials> adminCredentials)
    {
        _adminCredentials = adminCredentials.Value;
    }

    public bool ValidateCredentials(string username, string password)
    {
        return !string.IsNullOrEmpty(username) && 
               !string.IsNullOrEmpty(password) && 
               username == _adminCredentials.Username && 
               password == _adminCredentials.Password;
    }
}